package com.sibco.client.business;

import com.bstek.dorado.common.*;
import com.bstek.dorado.data.*;
import com.bstek.dorado.view.*;
import com.bstek.dorado.view.data.*;
import com.bstek.dorado.view.control.*;
import com.sibco.client.common.BaseViewModel;
import com.sibco.client.common.PayrollTools;

/**
 * SalaryDetailViewModel
 */
public class SalaryDetailViewModel extends BaseViewModel {
	private String columnsByDisplay="";
	  protected void doLoadData(ViewDataset dataset) throws Exception {
	    super.doLoadData(dataset);
	    String id=dataset.getId();
	    if("datasetShowColumns".equals(id)){
	            dataset.moveFirst();
	            columnsByDisplay=dataset.getValue(0).toString();
	    }
	    if ("datasetDataEditView".equals(id)) {
	            DoradoContext context=DoradoContext.getContext();
	            String paySendID=(String)context.getParameter("pay_send_id");
	            String groupIds="";

	            PayrollTools.filterColumns(dataset,paySendID,columnsByDisplay,groupIds,context);
	            PayrollTools.changeColumnName(dataset,context,1,paySendID);
//	            Tools.toSumDataset(dataset,"employee_name");


	    }
	  }

}
